package com.michael.study.module1;

import android.util.Log;

import com.michael.study.network.NetWorkModule;

import okhttp3.Interceptor;

/**
 * Description:
 *
 * <p>Created by liuguoquan on 2020/8/5 20:32.
 */
public class Module1Api extends NetWorkModule {

    public static volatile Module1Api sInstance;

    public static Module1Api getInstance() {
        if (null == sInstance) {
            synchronized (Module1Api.class) {
                if (null == sInstance) {
                    Log.d("lgq", "Module1Api getInstance: ");
                    sInstance = new Module1Api();
                }
            }
        }
        return sInstance;
    }

    public static <T> T getService(Class<T> clz) {
        return getInstance().getRetrofit(clz).create(clz);
    }

    @Override
    protected Interceptor getInterceptor() {
        return null;
    }

    @Override
    public String getFactoryUrl() {
        return "factory";
    }

    @Override
    public String getTestUrl() {
        return "test";
    }

    @Override
    public String getDevUrl() {
        return "url";
    }
}
